package thread.threadpool.example1;


/**
 * Description: 线程池用例一 测试类
 * date: 2022/11/18 10:39
 *
 * @author: Huangjunjie
 * @since JDK 1.8
 */
public class Example1Test {

    public static void main(String[] args) {
        //创建线程池类
        MyThreadPool pool = new MyThreadPool(2,4,20);
        //循环创建线程任务
        for(int i = 0;i < 300;i++){
            //创建任务
            MyTask mt = new MyTask(i);
            //向线程池里面添加任务
            pool.submit(mt);
        }
    }
}

